#define _CRT_SECURE_NO_WARNINGS 1

#include <iostream>
#include <string>
#include <map>
#include <queue>
#include<functional>
#include<vector>
#include<list>
using namespace std;

struct Node
{
	int info;
	Node* next;

	Node(int index) : info(index), next(nullptr) {}
};



void test3()
{
	int t, n, m;
	cin >> t;
	while (t--)
	{
		cin >> n >> m;
		vector<char> v(n);
		map<char, int> ci;
		vector<list<Node>> vl(n);
		string s;
		for (int i = 0; i < n; i++)
		{
			cin >> v[i];
			ci.insert(pair<char, int>(v[i], i));
		}
		
		while (m--)
		{
			cin >> s;

		}
	}

}

int main()
{
	test3();
	return 0;
}
